import request from '@/utils/request'
import { makeQueryParamsSafe } from '@/utils/kris_utils'

// 获取访客申请列表
export function getVisitList(data) {
  return request({
    url: `/v1/visit/application/list`,
    method: 'get',
    params: data
  })
}

// 删除访客记录
export function deleteVisitRecord(id) {
  return request({
    url: `/v1/visit/del/${id}`,
    method: 'delete'
  })
}

// 获取当前员工发出的邀请列表
export function getNowVisitList(data) {
  return request({
    url: `/v1/visit/apply`,
    method: 'get',
    params: data
  })
}

// 获取今日来访人员
export function today(company_id, params) {
  return request({
    url: `/v1/visit/today`,
    method: 'GET',
    params,
    headers: {
      'company-id': company_id
    }
  })
}

// 获取今日外出请假列表
export function out(company_id) {
  return request({
    url: `/v1/out`,
    method: 'GET',
    headers: {
      'company-id': company_id
    }
  })
}

// 审批来访人员
export function EditApproval(data) {
  return request({
    url: `/v1/visit/audit/administrator`,
    method: 'put',
    data: data
  })
}

// 访客获取微信小程序链接
export function getVisitorLink(id) {
  return request({
    url: `v1/visit/wx/link/${id}`,
    method: 'GET'
  })
}
